﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using WmWebSystem.Models;
using WmWebSystem.DbHelper;

namespace WmWebSystem.Service
{
    public static class ProjectService
    {
        public static bool IsLike(string pno)
        {
            WmDb mydb=new WmDb();
            string userName=HttpContext.Current.User.Identity.Name;
            int count = ProjectHelper.GetAttentionHelperProjectCount(pno, userName);
            if (count != 0)
                return true;
            else 
                return false;

        }

        public static int LikeCount(string pno)
        {
            int count = ProjectHelper.GetAttentionHelperProjectCount(pno, null);
            return count;
        }

        public static bool IsImage(string extension) 
        {
            string ex = extension.Trim().ToLower();
            if (ex == ".jpg" || ex == ".jpeg" || ex == ".gif" || ex == ".png" || ex == ".bmp")
                return true;
            else
                return false;
        }



    }
}